<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <p>我叫{{obj.name}},今年{{obj.age}}岁</p>
        <p>{{obj.age >= 18 ? "成年" : "未成年"}}</p>
        <p>{{msg.split(' ').length}}</p>
        <p>{{fn()}}</p>
    </div>
    <script src = "https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
        Vue.createApp({
            setup() {
                const msg = "Hello World!"
                const obj = {
                    name: "Vue",
                    age: 9
                }
                const fn = () => {
                    return 888
                }
                return {
                    msg,
                    obj,
                    fn
                }
            }
        }).mount('#app')
    </script>
</body>
</html>